PDBEDIT(8) | System Administration tools | PDBEDIT(8) |
NAME¶
pdbedit - manage the SAM database (Database of Samba Users)
SYNOPSIS¶
pdbedit [-L|--list] [-v|--verbose] [-w|--smbpasswd-style] [-u|--user=USER] [-N|--account-desc=STRING] [-f|--fullname=STRING] [-h|--homedir=STRING] [-D|--drive=STRING] [-S|--script=STRING] [-p|--profile=STRING] [-I|--domain=STRING] [-U|--user SID=STRING] [-M|--machine SID=STRING] [-a|--create] [-r|--modify] [-m|--machine] [-x|--delete] [-b|--backend=STRING] [-i|--import=STRING] [-e|--export=STRING] [-g|--group] [-y|--policies] [--policies-reset] [-P|--account-policy=STRING] [-C|--value=LONG] [-c|--account-control=STRING] [--force-initialized-passwords] [-z|--bad-password-count-reset] [-Z|--logon-hours-reset] [--time-format=STRING] [-t|--password-from-stdin] [-K|--kickoff-time=STRING] [--set-nt-hash=STRING] [-?|--help] [--usage] [-d|--debuglevel=DEBUGLEVEL] [--debug-stdout] [--configfile=CONFIGFILE] [--option=name=value] [-l|--log-basename=LOGFILEBASE] [--leak-report] [--leak-report-full]
DESCRIPTION¶
This tool is part of the samba(7) suite.
The pdbedit program is used to manage the users accounts stored in the sam database and can only be run by root.
The pdbedit tool uses the passdb modular interface and is independent from the kind of users database used (currently there are smbpasswd, ldap, nis+ and tdb based and more can be added without changing the tool).
There are five main ways to use pdbedit: adding a user account, removing a user account, modifying a user account, listing user accounts, importing users accounts.
OPTIONS¶
-L|--list
Example: pdbedit -L
sorce:500:Simo Sorce samba:45:Test User
-v|--verbose
Example: pdbedit -L -v
--------------- username: sorce user ID/Group: 500/500 user RID/GRID: 2000/2001 Full Name: Simo Sorce Home Directory: \\BERSERKER\sorce HomeDir Drive: H: Logon Script: \\BERSERKER\netlogon\sorce.bat Profile Path: \\BERSERKER\profile --------------- username: samba user ID/Group: 45/45 user RID/GRID: 1090/1091 Full Name: Test User Home Directory: \\BERSERKER\samba HomeDir Drive: Logon Script: Profile Path: \\BERSERKER\profile
-w|--smbpasswd-style
Example: pdbedit -L -w
sorce:500:508818B733CE64BEAAD3B435B51404EE:
D2A2418EFC466A8A0F6B1DBB5C3DB80C:
[UX ]:LCT-00000000: samba:45:0F2B255F7B67A7A9AAD3B435B51404EE:
BC281CE3F53B6A5146629CD4751D3490:
[UX ]:LCT-3BFA1E8D:
-u|--user username
-f|--fullname fullname
Example: -f "Simo Sorce"
-h|--homedir homedir
Example: -h "\\\\BERSERKER\\sorce"
-D|--drive drive
Example: -D "H:"
-S|--script script
Example: -S "\\\\BERSERKER\\netlogon\\sorce.bat"
--set-nt-hash
Example: --set-nt-hash 8846F7EAEE8FB117AD06BDD830B7586C
-p|--profile profile
Example: -p "\\\\BERSERKER\\netlogon"
-M|'--machine SID' SID|rid
Example: -M S-1-5-21-2447931902-1787058256-3961074038-1201
-U|'--user SID' SID|rid
Example: -U S-1-5-21-2447931902-1787058256-3961074038-5004
Example: '--user SID' S-1-5-21-2447931902-1787058256-3961074038-5004
Example: -U 5004
Example: '--user SID' 5004
-c|--account-control account-control
Example: -c "[X ]"
-K|--kickoff-time
Example: pdbedit -K never user
-a|--create
Example: pdbedit -a -u sorce
new password: retype new password
Note
pdbedit does not call the unix password synchronization script if unix password sync has been set. It only updates the data in the Samba user database.
If you wish to add a user and synchronise the password that immediately, use smbpasswd's -a option.
-t|--password-from-stdin
-r|--modify
-m|--machine
Example: pdbedit -a -m -u w2k-wks
-x|--delete
Example: pdbedit -x -u bob
-i|--import passdb-backend
This option will ease migration from one passdb backend to another.
Example: pdbedit -i smbpasswd:/etc/smbpasswd.old
-e|--export passdb-backend
This option will ease migration from one passdb backend to another and will ease backing up.
Example: pdbedit -e smbpasswd:/root/samba-users.backup
-g|--group
This option will ease migration from one passdb backend to another and will ease backing up.
-b|--backend passdb-backend
Example: pdbedit -b xml:/root/pdb-backup.xml -l
-P|--account-policy account-policy
Valid policies are: minimum password age, reset count minutes, disconnect time, user must logon to change password, password history, lockout duration, min password length, maximum password age and bad lockout attempt.
Example: pdbedit -P "bad lockout attempt"
account policy value for bad lockout attempt is 0
-C|--value account-policy-value
Example: pdbedit -P "bad lockout attempt" -C 3
account policy value for bad lockout attempt was 0 account policy value for bad lockout attempt is now 3
-y|--policies
This option will allow one to migrate account policies from their default tdb-store into a passdb backend, e.g. an LDAP directory server.
Example: pdbedit -y -i tdbsam: -e ldapsam:ldap://my.ldap.host
--force-initialized-passwords
-N|--account-desc description
Example: -N "test description"
-Z|--logon-hours-reset
Example: -Z
-z|--bad-password-count-reset
Example: -z
--policies-reset
Example: --policies-reset
-I|--domain
Example: -I "MYDOMAIN"
--time-format
-?|--help
--usage
-d|--debuglevel=DEBUGLEVEL
The higher this value, the more detail will be logged to the log files about the activities of the server. At level 0, only critical errors and serious warnings will be logged. Level 1 is a reasonable level for day-to-day running - it generates a small amount of information about operations carried out.
Levels above 1 will generate considerable amounts of log data, and should only be used when investigating a problem. Levels above 3 are designed for use only by developers and generate HUGE amounts of log data, most of which is extremely cryptic.
Note that specifying this parameter here will override the log level parameter in the /etc/samba/smb.conf file.
--debug-stdout
--configfile=<configuration file>
--option=<name>=<value>
-l|--log-basename=logdirectory
--leak-report
--leak-report-full
-V|--version
NOTES¶
This command may be used only by root.
VERSION¶
This man page is part of version 4.19.4 of the Samba suite.
SEE ALSO¶
AUTHOR¶
The original Samba software and related utilities were created by Andrew Tridgell. Samba is now developed by the Samba Team as an Open Source project similar to the way the Linux kernel is developed.
The pdbedit manpage was written by Simo Sorce and Jelmer Vernooij.
04/19/2024 | Samba 4.19.4 |